package com.lzx.shop.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 刘正星
 * @version 1.0.0
 * @ClassName MyBatisPlusConfig.java
 * @Description mybatis-plus分页插件
 * @createTime 2021年03月21日 11:04:00
 */
@Configuration
public class MyBatisPlusConfig {
    /**
     * mybatis-plus分页插件最新版
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }

}
